Skip to main content

Fog Plane Default

(fog_plane:default, 0x28871bcaafc3f4f3)

This template is referenced 1 time by fog_plane.

Technique fog

Render States

More info can be found on the Direct3D Docs

enum D3DRENDERSTATETYPE {
D3DRS_ZENABLE = 1,
D3DRS_ZFUNC = 4,
D3DRS_ZWRITEENABLE = 1,
D3DRS_ALPHABLENDENABLE = 1,
D3DRS_CULLMODE = 1,
D3DRS_COLORWRITEENABLE = 7,
D3DRS_COLORWRITEENABLE1 = 15,
D3DRS_COLORWRITEENABLE2 = 15,
D3DRS_STENCILENABLE = 0,
D3DRS_STENCILFUNC = 1,
D3DRS_STENCILFAIL = 1,
D3DRS_STENCILMASK = 0,
D3DRS_STENCILPASS = 1,
D3DRS_STENCILREF = 0,
D3DRS_STENCILWRITEMASK = 0,
D3DRS_STENCILZFAIL = 1,
D3DRS_DEPTHBIAS = 0,
D3DRS_SLOPESCALEDEPTHBIAS = 0,
D3DRS_FOGENABLE = 0,
D3DRS_SPECULARENABLE = 0,
D3DRS_ADAPTIVETESS_X = 0,
D3DRS_ADAPTIVETESS_Z = 0,
D3DRS_ADAPTIVETESS_W = 0,
D3DRS_SRGBWRITEENABLE = 0,
D3DRS_SEPARATEALPHABLENDENABLE = 0,
D3DRS_ALPHATESTENABLE = 0,
D3DRS_BLENDOP = 1,
D3DRS_DESTBLEND = 6,
D3DRS_SRCBLEND = 5,
};

Sampler States

More info can be found on the Direct3D Docs

Sampler 0

enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};

Shaders

Vertex Shader

float camera_far_range : register(vs_3_0, c7);
float ref_depth_fog_end : register(vs_3_0, c9);
float ref_depth_fog_start : register(vs_3_0, c8);
column_major float4x4 view_proj_matrix : register(vs_3_0, c0);
float3 vp_offset : register(vs_3_0, c11);
float3 vp_size : register(vs_3_0, c10);
column_major float4x4 world_view_matrix : register(vs_3_0, c4);
struct VertexMain_Input
{
float4 position : POSITION;
float4 normal : NORMAL;
};

struct VertexMain_Output
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
float texcoord3 : TEXCOORD3;
};

VertexMain_Output VertexMain(VertexMain_Input i)
{
VertexMain_Output o;
float3 temp0, temp2;
float4 temp1;
// def c12, 2, -1, 0, 0
// dcl_position v0
// dcl_normal v1
// dcl_position o0
// dcl_texcoord o1
// dcl_texcoord1 o2
// dcl_texcoord2 o3.xy
// dcl_texcoord3 o4.x
// mov r0.x, c9.x
temp0.x = ref_depth_fog_end.x;
// add r0.x, r0.x, -c8.x
temp0.x = temp0.x + -ref_depth_fog_start.x;
// rcp o3.y, r0.x
o.texcoord2.y = 1.0f / temp0.x;
// mov r0.x, c12.x
temp0.x = float1(2);
// mov r1.xy, c10
temp1.xy = vp_size.xy;
// mad r0.xy, c11, r0.x, r1
temp0.xy = vp_offset.xy * temp0.xx + temp1.xy;
// add r0.xy, r0, c12.y
temp0.xy = temp0.xy + float2(-1, -1);
// dp4 r1.w, v0, c3
temp1.w = dot(i.position, (view_proj_matrix._m03_m13_m23_m33));
// mul r0.xy, r0, r1.w
temp0.xy = temp0.xy * temp1.ww;
// dp4 r1.x, v0, c0
temp1.x = dot(i.position, (view_proj_matrix._m00_m10_m20_m30));
// mad o1.x, r1.x, c10.x, r0.x
o.texcoord.x = temp1.x * vp_size.x + temp0.x;
// dp4 r1.y, v0, c1
temp1.y = dot(i.position, (view_proj_matrix._m01_m11_m21_m31));
// mad o1.y, r1.y, -c10.y, r0.y
o.texcoord.y = temp1.y * -vp_size.y + temp0.y;
// mad r0.xyz, v1, c12.x, c12.y
temp0.xyz = i.normal.xyz * float3(2, 2, 2) + float3(-1, -1, -1);
// dp3 r2.x, r0, c4
temp2.x = dot(temp0.xyz, (world_view_matrix._m00_m10_m20_m30).xyz);
// dp3 r2.y, r0, c5
temp2.y = dot(temp0.xyz, (world_view_matrix._m01_m11_m21_m31).xyz);
// dp3 r2.z, r0, c6
temp2.z = dot(temp0.xyz, (world_view_matrix._m02_m12_m22_m32).xyz);
// nrm r0.xyz, r2
temp0.xyz = normalize(temp2.xyz).xyz;
// dp4 r2.x, v0, c4
temp2.x = dot(i.position, (world_view_matrix._m00_m10_m20_m30));
// dp4 r2.y, v0, c5
temp2.y = dot(i.position, (world_view_matrix._m01_m11_m21_m31));
// dp4 r2.z, v0, c6
temp2.z = dot(i.position, (world_view_matrix._m02_m12_m22_m32));
// dp3 o2.w, r2, r0
o.texcoord1.w = dot(temp2.xyz, temp0.xyz);
// mov o2.xyz, r0
o.texcoord1.xyz = temp0.xyz;
// dp4 r1.z, v0, c2
temp1.z = dot(i.position, (view_proj_matrix._m02_m12_m22_m32));
// mov o0, r1
o.position = temp1;
// mov o1.zw, r1
o.texcoord.zw = temp1.zw;
// rcp r0.x, c7.x
temp0.x = 1.0f / camera_far_range.x;
// mul r0.x, r0.x, r1.z
temp0.x = temp0.x * temp1.z;
// mov o3.x, r0.x
o.texcoord2.x = temp0.x;
// mov o4.x, r0.x
o.texcoord3 = temp0.x;
//

return o;
}

Decompiled by DXDecompiler.

Pixel Shader

float3 camera_unprojection : register(ps_3_0, c1);
sampler2D depth : register(ps_3_0, s0);
float3 ref_depth_fog_color : register(ps_3_0, c3);
float ref_depth_fog_start : register(ps_3_0, c2);
float3 render_target_texel_offset : register(ps_3_0, c0);
struct PixelMain_Input
{
float4 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
};

float4 PixelMain(PixelMain_Input i) : COLOR
{
float4 out_color;
float3 temp0;
float4 temp1;
// def c4, 0.5, 1, -1, 0
// dcl_texcoord v0.xyw
// dcl_texcoord1 v1
// dcl_texcoord2 v2.y
// dcl_2d s0
// rcp r0.x, v0.w
temp0.x = 1.0f / i.texcoord.w;
// mul r0.yz, r0.x, v0.xxyw
temp0.yz = temp0.xx * i.texcoord.xy;
// mov r1.x, c4.x
temp1.x = float1(0.5);
// mad r0.yz, r0, r1.x, c0.xxyw
temp0.yz = temp0.yz * temp1.xx + render_target_texel_offset.xy;
// add r0.yz, r0, c4.x
temp0.yz = temp0.yz + float2(0.5, 0.5);
// texld r1, r0.yzzw, s0
temp1 = tex2D(depth, temp0.yz);
// mul r0.yz, c4, v0.xxyw
temp0.yz = float2(1, -1) * i.texcoord.xy;
// mul r0.yz, r0, c1.xxyw
temp0.yz = temp0.yz * camera_unprojection.xy;
// mul r0.xy, r0.x, r0.yzzw
temp0.xy = temp0.xx * temp0.yz;
// mov r0.z, c4.y
temp0.z = float1(1);
// mul r0.xyz, r1, r0
temp0.xyz = temp1.xyz * temp0.xyz;
// dp3 r0.x, r0, v1
temp0.x = dot(temp0.xyz, i.texcoord1.xyz);
// add r0.x, r0.x, -v1.w
temp0.x = temp0.x + -i.texcoord1.w;
// add r0.x, r0_abs.x, -c2.x
temp0.x = abs(temp0).x + -ref_depth_fog_start.x;
// mul_sat oC0.w, r0.x, v2.y
out_color.w = saturate(temp0.x * i.texcoord2.y);
// mov oC0.xyz, c3
out_color.xyz = ref_depth_fog_color.xyz;
//

return out_color;
}

Decompiled by DXDecompiler.